<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class CreatSandTablePolymerizeDotInfoTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('sand_table_polymerize_dot_info', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('relationId')->default(0)->comment('关联的ID');
            $table->string('name', 120)->default('')->comment('名称');
            $table->decimal('lng', 10,6)->default(0)->comment('经度');
            $table->decimal('lat', 10,6)->default(0)->comment('纬度');
            $table->string('type', 32)->default('')->comment('各种类型');
            $table->string('subType', 32)->default('')->comment('子类');
            $table->unsignedInteger('cityCode')->default(0)->comment('城市code');
            $table->unsignedInteger('adcode')->default(0)->comment('区域code');
            $table->unsignedTinyInteger('grade')->default(0)->comment('网规等级');
            $table->unsignedTinyInteger('status')->default(0)->comment('用于展示是否评估');
            $table->json('boundary')->nullable()->comment('边界');

            $table->index(['cityCode', 'type', 'subType'], 'idx_city_dot');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sand_table_polymerize_dot_info');
    }
}
